class GetChatMassageModel {
  String msg;
  String senderType;
  String time;
  String sender;
  String senderImg;
  int isSelf;
  String monthDay;
  String timeDisplay;

  GetChatMassageModel({this.msg,
    this.senderType,
    this.time,
    this.sender,
    this.senderImg,
    this.isSelf});

  GetChatMassageModel.fromJson(Map<String, dynamic> json) {
    msg = json['msg'];
    senderType = json['sender_type'];
    time = json['time'];
    sender = json['sender'];
    senderImg = json['sender_img'];
    isSelf = json['is_self'];

    DateTime dateTime = DateTime.parse(json['time']);
    monthDay = "${dateTime.month}月${dateTime.day}日";
    timeDisplay = "${dateTime.hour}:${dateTime.minute}";
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['msg'] = this.msg;
    data['sender_type'] = this.senderType;
    data['time'] = this.time;
    data['sender'] = this.sender;
    data['sender_img'] = this.senderImg;
    data['is_self'] = this.isSelf;
    return data;
  }
}




